package com.lyncs.ods.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * 语言枚举类
 */
@AllArgsConstructor
@Getter
public enum LanguageEnum {
    /**
     * 语言
     */
    EN_US("en-US", "English (U.S.)", Boolean.TRUE),
    ZH_CN("zh-CN", "Chinese (Simplified)", Boolean.TRUE),
    ZH_HK("zh-HK", "Chinese (Hongkong)", Boolean.TRUE),
    ZH_TW("zh-TW", "Chinese (Taiwan)", Boolean.FALSE),
    KO_KR("ko-KR", "Korean", Boolean.FALSE),
    TH_TH("th-TH", "Thai", Boolean.FALSE),
    EN_NZ("en-NZ", "English (New Zealand)", Boolean.FALSE),
    EN_GB("en-GB", "English", Boolean.FALSE),
    ES_ES("es-ES", "Spanish", Boolean.FALSE),
    EN_PH("en-PH", "English (Philippines)", Boolean.FALSE),
    IT_IT("it-IT", "Italian", Boolean.FALSE),
    RU_RU("ru-RU", "Russian", Boolean.FALSE),
    DE_DE("de-DE", "German", Boolean.FALSE),
    EN_AU("en-AU", "English (Australia)", Boolean.FALSE),
    EN_CA("en-CA", "English (Canada)", Boolean.FALSE),
    JA_JP("ja-JP", "Japanese", Boolean.FALSE),
    ID_ID("id-ID", "Indonesian", Boolean.FALSE),
    VI_VN("vi-VN", "Vietnamese", Boolean.FALSE),
    FR_FR("fr-FR", "French", Boolean.FALSE),
    EN_SG("en-SG", "Singapore English", Boolean.FALSE),
    EN_HK("en-HK", "Hong Kong English", Boolean.FALSE),
    EN_MY("en-MY", "Malaysian English", Boolean.FALSE),
    EN_IN("en-IN", "Indian English", Boolean.FALSE),
    EN_BS("en-BS", "International English", Boolean.FALSE),
    ;

    private String language;
    private String description;
    private Boolean enable;

    public static LanguageEnum getLanguageEnum(String language) {
        return Arrays.stream(LanguageEnum.values()).filter(lan -> lan.getLanguage().equals(language)).findAny().orElse(null);
    }
}
